package com.xwj.config;

import com.xwj.Enums.StatusInfoEnum;
import com.xwj.service.Impl.RaStatusInfoServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * 项目启动时执行的操作
 */
@Component
@Order(1)
public class MyApplicationRunner implements ApplicationRunner {

    @Autowired
    private RaStatusInfoServiceImpl raStatusInfoService;

    @Override
    public void run(ApplicationArguments applicationArguments) throws Exception {
        raStatusInfoService.findStatusByLabel(StatusInfoEnum.CloudHouse.getName());
        raStatusInfoService.findStatusByLabel(StatusInfoEnum.HouseInfo.getName());
        raStatusInfoService.findStatusByLabel(StatusInfoEnum.RepirInfo.getName());
        raStatusInfoService.findStatusByLabel(StatusInfoEnum.OrderInfo.getName());
    }
}
